/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package au.edu.swin.unilearn.assignment;

import java.io.Serializable;

/**
 *
 * @author DidierLeung
 */
public class AssignmentPK implements Serializable 
{
    private String assignment_no;
    private String subject_code;

    public AssignmentPK()
    {
    }

    public AssignmentPK(String assignmentNo, String subjectCode)
    {
        this.assignment_no = assignmentNo;
        this.subject_code = subjectCode;
    }

    public String getAssignmentNo()
    {
        return assignment_no;
    }

    public void setAssignmentNo(String assignmentNo)
    {
        this.assignment_no = assignmentNo;
    }

    public String getSubjectCode()
    {
        return subject_code;
    }

    public void setSubjectCode(String subjectCode)
    {
        this.subject_code = subjectCode;
    }
    
    @Override
    public boolean equals(Object obj)
    {
        AssignmentPK pk = (AssignmentPK) obj;
        if(assignment_no.equals(pk.getAssignmentNo()) && 
                                subject_code.equals(pk.getSubjectCode()))
        {
            return true;
        }
        else
        {
            return false;
        }
    }
    
    @Override
    public int hashCode()
    {
        return assignment_no.hashCode() + subject_code.hashCode();
    }
    
    @Override
    public String toString()
    {
        return "au.edu.swin.unilearn.assignment.AssignmentEntity[id=" + assignment_no + "]";
    }
}
